﻿<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <xi:include href="macros.html" />
  <head>
    <title>Milestone Dashboard: ${milestone.name}</title>
    <script type="text/javascript">
      $(document).ready(function() {
        $("#content").find("h1,h2,h3,h4,h5,h6").addAnchor("Link to this section");
      });
    </script>
  </head>

  <body>
    <div id="ctxtnav" class="nav"></div>

    <div id="content" class="milestone">
      <h1>Milestone Dashboard: <a href="${href.milestone(milestone.name)}">${milestone.name}</a></h1>
      
        <form id="prefs" method="get" action="">
          <div>
            <label>Milestone Start Date: <input type="text" size="10" name="from" value="${format_date(fromdate)}" /></label> <br />
          </div>
          <div class="buttons">
            <input type="submit" name="update" value="Update" />
          </div>
        </form>
      
      
      <div class="info">
        <py:choose>
          <p py:when="milestone.completed" class="date">
            Completed ${dateinfo(milestone.completed)} ago
            (${format_date(milestone.completed)})
          </p>
          <p py:when="milestone.is_late" class="date">
            <strong>${dateinfo(milestone.due)} late</strong>
            (${format_date(milestone.due)})
          </p>
          <p py:when="milestone.due" class="date">
            Due in ${dateinfo(milestone.due)}
            (${format_date(milestone.due)})
          </p>
          <p py:otherwise="" class="date">
            No date set
          </p>
        </py:choose>
      	<h2>Ticket Status Summary</h2>  
        <py:if test="stats.count">${progress_bar(stats, interval_hrefs, stats_href=stats_href)}</py:if>
       	<h2>Ticket Type Summary</h2>  
      	<py:if test="ticketstat.stats.count">${progress_bar(ticketstat.stats, ticketstat.interval_hrefs,stats_href=ticketstat.stats_href)}</py:if>

      </div>

	  <div>	<img src="${href.mdashboard('%s/cummulativeflow.png' % (milestone.name,))}"/></div>     
      <div class="table">
      	<h2>Ticket History Table</h2>
      	
      	<table style="width: 300px" class="listing ticket history">
	      <thead>
				<tr>
					<th style="width: 90px">Date</th>
					<th style="width: 50px">Enter</th>
					<th style="width: 55px">Leave</th>
					<th style="width: 90px">Completed</th>
				</tr>
			</thead>
			<tbody>
					<tr py:for="idx, date in enumerate(dates)" class="date">
						<td style="width: 90px">${format_date(date,tzinfo=utc)}</td>
						<td style="width: 50px">${tickethistory['Enter'][idx]}</td>
						<td style="width: 55px">${tickethistory['Leave'][idx]}</td>
						<td style="width: 90px">${tickethistory['Finish'][idx]}</td>
					</tr>
			</tbody>			
		</table>
	  </div>
    </div>


    <div id="help"><strong>Note:</strong> See
      <a href="${href.wiki('TracRoadmap')}">TracRoadmap</a> for help on using
      the roadmap.
    </div>

  </body>
</html>
